package main

import (
	"fmt"
	"os"
)
func main() {
	file, e := os.Open("C:\\object\\码云库\\go_study\\base\\imput.dat")
	if e != nil {
		fmt.Println(e)
	}
	buf := make([]byte,1024)
	for {
		len, _ := file.Read(buf)
		if len == 0 {
			break
		}
		fmt.Println(string(buf))
	}

	buf1 := make([]byte,1024)
	offset := 0
	for {
		len1, _ := file.ReadAt(buf1, int64(offset))
		offset = offset + len1
		if len1 == 0 {
			break
		}
		fmt.Println(string(buf1))
	}
	file.Close()
}
